# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=gnome-dictionary
pkgver=40.0
pkgrel=2
pkgdesc="Look up words in dictionary sources"
url="https://wiki.gnome.org/Apps/Dictionary"
arch=(loong64 x86_64)
license=(GPL2)
depends=(gtk3)
makedepends=(
  appstream-glib
  git
  meson
  yelp-tools
)
groups=(gnome-extra)
_commit=c37edfc2cbf91d6bae6d5264d0dcfcb5dd34b313  # tags/40.0^0
source=("git+https://gitlab.gnome.org/GNOME/gnome-dictionary.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd $pkgname

  # Fix build with newer meson
  git cherry-pick -n 87c026cfe4acbcfc62d15950f88a71d8d9678c7e \
                     cf3f8a67cd6f3059c555ed9cf0f5fba10abb7f68
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
